#ifndef CCHARACTER_H_
#define CCHARACTER_H_
#include <string>
#include "CBase.h"
#include "CAnimationManager.h"
#include "IListener.h"
#include <vector>
using std::vector;

enum {TEAM_NULL,TEAM_RED,TEAM_BLUE,TEAM_GREEN,TEAM_MAX};
enum {STATE_NULL,STATE_STAND,STATE_CROUCH,STATE_AIR,STATE_MAX};
enum CHARA{CHARA_NULL,CHARA_YOUMU,CHARA_SAKUYA,CHARA_ALICE,CHARA_YUYUKO,CHARA_MAX};

class CState;

class CCharacter : public CBase,IListener
{
	//gameplay specific
	char cTeam;
	char cState;
	unsigned char ucHeldItem;
	CHARA eCharacter;
	string m_szCharacter;
	//controls
	bool bUp;
	bool bDown;
	bool bLeft;
	bool bRight;
	bool bA;
	bool bB;
	bool bC;
	bool bD;
	//data
	short sCurrLife;
	short sMaxLife;
	short sCurrEnergy;
	short sMaxEnergy;
	unsigned char ucAtkPercent;
	unsigned char ucDefPercent;
	float fLiedownTime;
	float xScale;
	float yScale;
	bool bFlipped;
	bool bControl;
	CState* pCurrState;
	vector<CState*> vStates;
	AnimInfo* pAnim;
	int* paSoundIds;
	//Movement
	float fWalkVelFx;
	float fWalkVelFy;
	float fWalkVelBx;
	float fWalkVelBy;
	float fRunVelFx;
	float fRunVelFy;
	float fRunVelBx;
	float fRunVelBy;
	float fJumpVelNx;
	float fJumpVelNy;
	float fJumpVelFx;
	float fJumpVelFy;
	float fJumpVelBx;
	float fJumpVelBy;
	float fRunJumpVelFx;
	float fRunJumpVelFy;
	float fRunJumpVelBx;
	float fRunJumpVelBy;
	float fAirJumpVelNx;
	float fAirJumpVelNy;
	float fAirJumpVelFx;
	float fAirJumpVelFy;
	float fAirJumpVelBx;
	float fAirJumpVelBy;
	unsigned char ucAirJumpNum;
	unsigned char ucAirJumpMax;
	float fAirJumpTime;
	float fStandFriction;
	float fCrouchFriction;
	float fGravityX;
	float fGravityY;
	//in character variables
	int nVariables[60];
	int fVariables[40];

	//Temporary variables
	float floor;
public:
	CCharacter();
	~CCharacter();
	void Update(float fElapsedTime);
	void Render();
	void HandleInput();
	void HandleEvent(CEvent* pEvent);
	void SetCharacter(char* szCharacter){m_szCharacter = szCharacter;}
};
#endif